extends "../calxJS_Hide/calxJS_Hide.gd"
func _init():
	pass
func _extInit():
	._extInit()
	chaName = "微光幽灵"                   # 角色的名称
	attCoe.atkRan = 1                 # 攻击距离
	attCoe.maxHp = 6.4                 # 最大生命（每点代表112.5基础数值，取整数，下同）
	attCoe.atk = 4                   # 攻击力（每点代表8.5）
	attCoe.mgiAtk = 1                 # 魔法攻击（每点代表13.7）
	attCoe.def = 3                    # 物理防御（每点代表15）
	attCoe.mgiDef = 2.5               # 魔法防御（每点代表16.6）
	atkEff = "atk_dao" 
	xb = "神秘"
	lv = 3
	addSkillTxt("[幽灵身躯]缥缈的躯体使受到物理伤害时有30%概率无效，受到魔法伤害时有15%概率翻倍\n血量低于30%时，物理无效的概率翻倍")
	addSkillTxt("[恶魔低语]在敌人接近自己时在敌人脑内低语，受到暴击伤害时，使该伤害降低60%并有50%概率<诅咒>对方6秒\n受到非普攻伤害时，15%概率让随机敌军承受")
	addSkillTxt("[噬魂]场上每有一个非召唤亚比阵亡，吞噬该灵魂用来恢复自身5%最大体力值，双防各提升10%，最高至60%")

func _onHurt(atkInfo):
	._onHurt(atkInfo)
	if atkInfo.atkType == Chara.HurtType.PHY:
		if att.hp < att.maxHp * 0.5 &&  sys.rndPer(60):
			atkInfo.hurtVal = 0
		elif sys.rndPer(30):
			atkInfo.hurtVal = 0
	if atkInfo.atkType == Chara.HurtType.MGI && sys.rndPer(15):
		atkInfo.hurtVal *= 2
	if atkInfo.isCri:
		atkInfo.hurtVal *= 0.4
		if sys.rndPer(50):
			atkInfo.atkCha.addBuff(bf.zuzhou.new(6))
	if atkInfo.atkType != Chara.AtkType.NORMAL && sys.rndPer(15):
		var cha = utils.getRndEnemy(self)
		typeHurtCha(cha,atkInfo.hurtVal * 1,atkInfo.hurtType,Chara.AtkType.EFF)
		atkInfo.hurtVal = 0

func _onCharaDel(cha):
	._onCharaDel(cha)
	var b = hasBuff("wukang1")
	var b1 = hasBuff("mokang1")
	if !cha.isSumm && isDeath == false:
		plusHp(att.maxHp * 0.05)
		if b == null:
			addBuff(bf.wukang1.new())
		elif b.att.defL < 0.6:
			b.att.defL += 0.1
		if b1 == null:
			addBuff(bf.mokang1.new())
		elif b1.att.mgiDefL < 0.6:
			b1.att.mgiDefL += 0.1

